<script setup lang="ts">
import { ref } from 'vue'
import ChildComp from './components/ChildComp.vue'

// 1.父组件提供数据
const count = ref(100)
const house = ref('小房子')
</script>

<template>
  <div class="app-page">
    <!-- 3.父注册事件 -->
     <!-- 这里事件传来的参数用$event接收 -->
    <ChildComp :count="count" :house="house"
    @change-count="count+=$event"
    @change-house="house=$event"
    />
  </div>
</template>

<!-- scoped 解决组件样式冲突 -->
<style lang="css" scoped></style>
